<%--
  Created by IntelliJ IDEA.
  User: 徐洲
  Date: 2023/12/18
  Time: 10:45
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>摆烂俱乐部后台</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="../vendor/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="../vendor/font-awesome/css/font-awesome.min.css">
    <!-- Google fonts - Roboto -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,700">
    <!-- owl carousel-->
    <link rel="stylesheet" href="../vendor/owl.carousel/assets/owl.carousel.css">
    <link rel="stylesheet" href="../vendor/owl.carousel/assets/owl.theme.default.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="../css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="../css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="../favicon.png">
    <!-- Tweaks for older IEs--><!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->


    <link rel="canonical" href="https://getbootstrap.com/docs/4.6/examples/sign-in/">
    <!-- Bootstrap core CSS -->

    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }
    </style>

    <link href="../css/signin.css" rel="stylesheet">
</head>
<body class="text-center">

<form class="form-signin" method="post" action="./admin?action=login">
    <img class="mb-4" src="../favicon.png" alt="摆烂俱乐部" width="72" height="72">
    <h1 class="h3 mb-3 font-weight-normal">管理员登录</h1>
    <div class="form-group">
        <label for="admin_name" class="sr-only">用户名</label>
        <input type="text" id="admin_name" name="admin_name" class="form-control" placeholder="请输入用户名" required autofocus>
    </div>
    <div class="form-group">
        <label for="admin_password" class="sr-only">密码</label>
        <input type="password" id="admin_password" name="admin_password" class="form-control" pattern="(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{6,}" title="密码必须包含至少一个字母和一个数字，且长度不少于6位" placeholder="请输入密码" required>
    </div>
    <div class="form-group">
        <input style="margin-bottom: 20px" type="text" class="form-control" required placeholder="验证码" name="captcha">
        <img alt="加载中……" src="../check" id="img" border="1" onclick="reload()">
        <p style="color: red">${codefail}</p>
        <p style="color:red;">${fail}</p>
    </div>
    <div class="text-center">
        <button type="submit" name="submit" class="btn btn-primary"><i
                class="fa fa-sign-in"></i> 登录
        </button>
        <button type="reset" name="submit" class="btn btn-primary"><i class="fa fa-refresh"></i>重置</button>
    </div>
    <p class="mt-5 mb-3 text-muted">Copyright &copy; 2023. 摆烂俱乐部 All rights reserved.</p>
</form>

<script>
    function reload() {
        const timestamp = new Date().getTime();  // 获取当前时间戳
        const img = document.getElementById('img');
        img.src = "../check?t=" + timestamp;  // 在图片链接后添加时间戳参数
    }
</script>
<script src="../vendor/jquery/jquery.min.js"></script>
<script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
<script src="../vendor/jquery.cookie/jquery.cookie.js"> </script>
<script src="../vendor/owl.carousel/owl.carousel.min.js"></script>
<script src="../vendor/owl.carousel2.thumbs/owl.carousel2.thumbs.js"></script>
<script src="../js/front.js"></script>
</body>
</html>
